<!DOCTYPE html>
<html lang="en" dir="auto">

<head><meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="robots" content="index, follow">
<title>柚子的博客</title>

<meta name="description" content="">
<meta name="author" content="">
<link rel="canonical" href="http://example.org/" />
<link crossorigin="anonymous" href="/assets/css/stylesheet.min.5e2b4101351c21e906f398ae96901791830f58d430f96f2659dab7eaef7b3cb7.css" integrity="sha256-XitBATUcIekG85iulpAXkYMPWNQw&#43;W8mWdq36u97PLc=" rel="preload stylesheet" as="style">
<link rel="icon" href="http://example.org/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="http://example.org/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="http://example.org/favicon-32x32.png">
<link rel="apple-touch-icon" href="http://example.org/apple-touch-icon.png">
<link rel="mask-icon" href="http://example.org/safari-pinned-tab.svg">
<meta name="theme-color" content="#2e2e33">
<meta name="msapplication-TileColor" content="#2e2e33">
<meta name="generator" content="Hugo 0.88.1" />
<link rel="alternate" type="application/rss+xml" href="http://example.org/index.xml">
<noscript>
    <style>
        #theme-toggle,
        .top-link {
            display: none;
        }

    </style>
    <style>
        @media (prefers-color-scheme: dark) {
            :root {
                --theme: rgb(29, 30, 32);
                --entry: rgb(46, 46, 51);
                --primary: rgb(218, 218, 219);
                --secondary: rgb(155, 156, 157);
                --tertiary: rgb(65, 66, 68);
                --content: rgb(196, 196, 197);
                --hljs-bg: rgb(46, 46, 51);
                --code-bg: rgb(55, 56, 62);
                --border: rgb(51, 51, 51);
            }

            .list {
                background: var(--theme);
            }

            .list:not(.dark)::-webkit-scrollbar-track {
                background: 0 0;
            }

            .list:not(.dark)::-webkit-scrollbar-thumb {
                border-color: var(--theme);
            }
        }

    </style>
</noscript><meta property="og:title" content="柚子的博客" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://example.org/" />

<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="柚子的博客"/>
<meta name="twitter:description" content=""/>
<meta name="twitter:site" content="@https://twitter.com/forestryio"/>

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "柚子的博客",
  "url": "http://example.org/",
  "description": "",
  "thumbnailUrl": "http://example.org/favicon.ico",
  "sameAs": [
      
  ]
}
</script>
</head>

<body class="list" id="top">
<script>
    if (localStorage.getItem("pref-theme") === "dark") {
        document.body.classList.add('dark');
    } else if (localStorage.getItem("pref-theme") === "light") {
        document.body.classList.remove('dark')
    } else if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
        document.body.classList.add('dark');
    }

</script>

<header class="header">
    <nav class="nav">
        <div class="logo">
            <a href="http://example.org/" accesskey="h" title="柚子的博客 (Alt + H)">柚子的博客</a>
            <span class="logo-switches">
                <button id="theme-toggle" accesskey="t" title="(Alt + T)">
                    <svg id="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                        fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                        stroke-linejoin="round">
                        <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
                    </svg>
                    <svg id="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
                        fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
                        stroke-linejoin="round">
                        <circle cx="12" cy="12" r="5"></circle>
                        <line x1="12" y1="1" x2="12" y2="3"></line>
                        <line x1="12" y1="21" x2="12" y2="23"></line>
                        <line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
                        <line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
                        <line x1="1" y1="12" x2="3" y2="12"></line>
                        <line x1="21" y1="12" x2="23" y2="12"></line>
                        <line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
                        <line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
                    </svg>
                </button>
            </span>
        </div>
        <ul id="menu">
        </ul>
    </nav>
</header>
<main class="main"> 

<article class="first-entry"> 
  <header class="entry-header">
    <h2>Qt widget关闭时自动释放内存
    </h2>
  </header>
  <section class="entry-content">
    <p>给widget设置Qt::WA_DeleteOnClose的属性就好啦
Widget-&gt;setAttribute(Qt::WA_DeleteOnClose); </p>
  </section>
  <footer class="entry-footer">May 2, 2021</footer>
  <a class="entry-link" aria-label="post link to Qt widget关闭时自动释放内存" href="http://example.org/post/qt-widget%E5%85%B3%E9%97%AD%E6%97%B6%E8%87%AA%E5%8A%A8%E9%87%8A%E6%94%BE%E5%86%85%E5%AD%98/"></a>
</article>

<article class="post-entry"> 
  <header class="entry-header">
    <h2>git记住用户名密码
    </h2>
  </header>
  <section class="entry-content">
    <p>hexo部署时用户名密码问题：
记住用户名密码，不用每次都输入用户名密码
`git config --global credential.helper store 清除用户名密码，防止用户名密码输入错误
`git config --system --unset credential.helper </p>
  </section>
  <footer class="entry-footer">May 1, 2021</footer>
  <a class="entry-link" aria-label="post link to git记住用户名密码" href="http://example.org/post/git%E8%AE%B0%E4%BD%8F%E7%94%A8%E6%88%B7%E5%90%8D%E5%AF%86%E7%A0%81/"></a>
</article>

<article class="post-entry"> 
  <header class="entry-header">
    <h2>QT DTK代码片段
    </h2>
  </header>
  <section class="entry-content">
    <p>标题栏：
1、标题栏着色 
`titlebar()-&gt;setAttribute(Qt::WA_StyledBackground,true); titlebar()-&gt;setStyleSheet(&#34;background-color: rgb(97,172,133)&#34;); 2、隐藏标题栏下面分隔线 `titlebar()-&gt;setSeparatorVisible(false); 3、标题栏透明 `titlebar-&gt;setBackgroundTransparent(true); 4、标题栏相关文档 官方文档
控件：
1、判断系统主题是浅色还是暗色 `DGuiApplicationHelper *guiAppHelp = DGuiApplicationHelper::instance(); if (guiAppHelp-&gt;themeType() == DGuiApplicationHelper::ColorType::DarkType) { //暗色主题 } else { //浅色主题 } 2、判断某个颜色是浅色还是暗色 `if(tcolor.red()*0.299 &#43; tcolor.green()*0.578 &#43; tcolor.blue()*0.114 &gt;= 192){ //浅色 }else{ //深色 } 3、QT控件阴影效果 `this-&gt;setWindowFlags(Qt::FramelessWindowHint); QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; effect-&gt;setBlurRadius(8); // 阴影圆角的大小 effect-&gt;setColor(Qt::gray); //阴影的颜色 effect-&gt;setOffset(5,5); //阴影的偏移量 ui-&gt;centralWidget-&gt;setGraphicsEffect(effect); //给那个控件设置阴影，这里需要注意的是所有此控件的子控件，也都继承这个阴影。 </p>
  </section>
  <footer class="entry-footer">May 1, 2021</footer>
  <a class="entry-link" aria-label="post link to QT DTK代码片段" href="http://example.org/post/qt-dtk%E4%BB%A3%E7%A0%81%E7%89%87%E6%AE%B5/"></a>
</article>

<article class="post-entry"> 
  <header class="entry-header">
    <h2>README
    </h2>
  </header>
  <section class="entry-content">
    <p>🍭 编译hahah 依赖安装 sudo apt install qt5-qmake qttools5-dev-tools libdtkwidget-dev debhelper gsettings-desktop-schemas libdtkwidget5 libdtkgui5 libdtkgui5 fakeroot 编译 dpkg-buildpackage -b -d ✨特性  🍕 Deepin首个个性定制工具 🍥 提供DDE功能和外观定制项 🍔 点点鼠标就能定制属于自己的Deepin 🍟 右键菜单随意调整，提高工作效率 🌭 更多功能，敬请期待……  🎨 截图    🥼 DDE外观界面调整 🧥 右键菜单提高工作效率         👔 好看的UI风格 👕 右键菜单管理        </p>
  </section>
  <footer class="entry-footer"></footer>
  <a class="entry-link" aria-label="post link to README" href="http://example.org/post/readme/"></a>
</article>
    </main>
    
<footer class="footer">
    <span>&copy; 2021 <a href="http://example.org/">柚子的博客</a></span>
    <span>
        Powered by
        <a href="https://gohugo.io/" rel="noopener noreferrer" target="_blank">Hugo</a> &
        <a href="https://git.io/hugopapermod" rel="noopener" target="_blank">PaperMod</a>
    </span>
</footer>
<a href="#top" aria-label="go to top" title="Go to Top (Alt + G)" class="top-link" id="top-link" accesskey="g">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 6" fill="currentColor">
        <path d="M12 6H0l6-6z" />
    </svg>
</a>

<script>
    let menu = document.getElementById('menu')
    menu.scrollLeft = localStorage.getItem("menu-scroll-position");
    menu.onscroll = function () {
        localStorage.setItem("menu-scroll-position", menu.scrollLeft);
    }

    document.querySelectorAll('a[href^="#"]').forEach(anchor => {
        anchor.addEventListener("click", function (e) {
            e.preventDefault();
            var id = this.getAttribute("href").substr(1);
            if (!window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
                document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView({
                    behavior: "smooth"
                });
            } else {
                document.querySelector(`[id='${decodeURIComponent(id)}']`).scrollIntoView();
            }
            if (id === "top") {
                history.replaceState(null, null, " ");
            } else {
                history.pushState(null, null, `#${id}`);
            }
        });
    });

</script>
<script>
    var mybutton = document.getElementById("top-link");
    window.onscroll = function () {
        if (document.body.scrollTop > 800 || document.documentElement.scrollTop > 800) {
            mybutton.style.visibility = "visible";
            mybutton.style.opacity = "1";
        } else {
            mybutton.style.visibility = "hidden";
            mybutton.style.opacity = "0";
        }
    };

</script>
<script>
    document.getElementById("theme-toggle").addEventListener("click", () => {
        if (document.body.className.includes("dark")) {
            document.body.classList.remove('dark');
            localStorage.setItem("pref-theme", 'light');
        } else {
            document.body.classList.add('dark');
            localStorage.setItem("pref-theme", 'dark');
        }
    })

</script>
</body>

</html>
